<template>
  <div class="box">
    <ul>
      <li v-for="(item, index) in list">
        <div class="div">
          <p>{{ item.lottery_no }}期</p>
          <p>{{ item.lottery_exdate }}开奖</p>
        </div>
        <div class="numb">
          <div
            class="number"
            v-for="(obj, i) in item.lottery_res.split(',')"
            :key="i"
          >
            {{ obj }}
          </div>
        </div>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  components: {},
  data() {
    return {
      id: "",
      list: [],
    };
  },
  methods: {},
  onShow() {
    this.id = uni.getStorageSync("id");
    console.log(this.id);
    uni.request({
      url: "http://api.aslegou.top/api/cphistory",
      method: "GET",
      data: { lottery_id: this.id },
      success: (res) => {
        this.list = res.data.list.lotteryResList;
        // this.arr=this.list.lottery_res.split(',')
        console.log(res.data.list);
        console.log(this.list);
      },
    });
  },
};
</script>
<style>
.numb {
  display: flex;
}
.number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid pink;
  line-height: 40px;
  text-align: center;
}
li {
  padding-left: 25px;
  border-bottom: 1px solid #000;
  padding: 20px;
}
.div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 15px 0;
}
</style>
